#include <iostream>
#include <unistd.h>
#include "processBar.h"

void download(processBar& bar)
{
	int total=1024;
	int cur=0;
	while(cur<=total)
	{
		int rate=cur*100/total;
		bar.work(rate);
		cur+=10;
		usleep(50000);
	}
	bar.work(100);
	std::cout<<std::endl;
}

int main()
{
	processBar pb;
	download(pb);
	pb.clear();
	processBar t=pb;
	t.work(100);
	std::cout<<std::endl;
	//download(pb);
	return 0;	
}
